package com.csap.framework.oauth2.server.entity;

import com.csap.framework.annotation.apidoc.Description;
import com.csap.framework.oauth2.server.model.ScopeModel;
import com.csap.mybatisplus.annotation.IdType;
import com.csap.mybatisplus.annotation.TableField;
import com.csap.mybatisplus.annotation.TableId;
import com.csap.mybatisplus.annotation.TableLogic;
import com.csap.mybatisplus.annotation.TableName;
import com.csap.mybatisplus.extension.activerecord.Model;
import com.csap.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 作用域
 * </p>
 *
 * @author yangchengfu
 * @dateTime 2021-07-25 23:51:30
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "scope", autoResultMap = true)
@Description(value = "作用域实体类")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ScopeEntity extends Model<ScopeEntity, ScopeModel> {
    /**
     * 作用域ID
     */
    @TableId(type = IdType.AUTO, value = "scope_id")
    private Long scopeId;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 作用域名称
     */
    private String name;
    /**
     * 作用域描述
     */
    private String descr;
    /**
     * 是否删除
     */
    @TableLogic(delval = "1", value = "0")
    private Integer del;
    /**
     * 权限
     */
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private List<String> permissions;
}
